/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gob.fonafe.service.impl;

import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pe.gob.fonafe.dao.BannerDAO;
import pe.gob.fonafe.domain.BannerBean;
import pe.gob.fonafe.service.BannerService;

/**
 *
 * @author czela
 */
@Service
public class BannerServiceImpl implements BannerService{

    private static final Logger logger = Logger.getLogger(BannerServiceImpl.class);

    @Autowired
    private BannerDAO bannerDAO;

    public List<BannerBean> obtenerBanner() {
        List<BannerBean> obtenerBanenr = new ArrayList<BannerBean>();
        try{
            obtenerBanenr = bannerDAO.obtenerBanner();
        }catch(Exception ex){
            ex.printStackTrace();
            logger.error(ex);
        }
        return obtenerBanenr;
    }

    public String[] actualizarBanner(BannerBean bean) {
        String[] outPuts = new String[2];
        try{
            outPuts = bannerDAO.actualizarBanner(bean);
        }catch(Exception ex){
            ex.printStackTrace();
            logger.error(ex);
        }
        return outPuts;
    }

}
